package com.sctvcloud.zhaohua_sd.beans;

import android.support.annotation.NonNull;
import android.text.TextUtils;

import com.ruihang.generalibrary.ui.util.IListData;
import com.ruihang.generalibrary.utils.IDataDate;
import com.sctvcloud.zhaohua_sd.R;
import com.sctvcloud.zhaohua_sd.application.Constances;
import com.sctvcloud.zhaohua_sd.ui.datainf.IHour24Data;
import com.sctvcloud.zhaohua_sd.ui.util.IListShowData;

import java.io.Serializable;
import java.sql.Date;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2017/7/5.
 */

public class FRebellion implements IHour24Data, Serializable, IListShowData,IDataDate {
    private static final long serialVersionUID = -8081856801253321419L;
    private String coverImage;
    private List<ImageUr> discloseImage;
    private String discloseText;
    private int discloseType;
    private String discloseVideo;
    private String location;
    private String pubTime;
    private String userAvator;
    private String userName;
    private Date pubTimeTemp;
    private boolean isShrink;
    private String sharedUrl;

    private int playedPos;


    private String note;
    private boolean isComment;
    private String infoId;// 消息id
    private String baoType;//取值null：没有备注  0为普通采用  1 为谣言
    private boolean isDigg; //当前用户是否点赞
    private String topicId; //报料话题id，null：普通报料，未选择话题
    private String topic; //话题内容
    private int countDigg;//点赞数量
    private int countComment;//评论数量
    private ArrayList<FComment> commentList;
    protected int viewType = 0;
    private String discloseTitle;
    private int isAnon;
    private int accessStatus;
    private int isPrize;
    private Branch branch;

    public Branch getBranch() {
        return branch;
    }

    public void setBranch(Branch branch) {
        this.branch = branch;
    }

    public int getIsPrize() {
        return isPrize;
    }

    public void setIsPrize(int isPrize) {
        this.isPrize = isPrize;
    }

    public int getAccessStatus() {
        return accessStatus;
    }

    public void setAccessStatus(int accessStatus) {
        this.accessStatus = accessStatus;
    }
    public int getIsAnon() {
        return isAnon;
    }

    public void setIsAnon(int isAnon) {
        this.isAnon = isAnon;
    }

    public String getDiscloseTitle() {
        return discloseTitle;
    }

    public void setDiscloseTitle(String discloseTitle) {
        this.discloseTitle = discloseTitle;
    }

    public int getViewType() {
        return viewType;
    }

    public FRebellion setViewType(int viewType) {
        this.viewType = viewType;
        return this;
    }

    public String getSharedUrl() {
        return sharedUrl;
    }

    public void setSharedUrl(String sharedUrl) {
        this.sharedUrl = sharedUrl;
    }

    @Override
    public String getDataTitle() {
        return null;
    }

    @Override
    public String getDataImg() {
        return discloseImage.get(0).getImageUrl();
    }

    @Override
    public String getDataTag() {
        return null;
    }

    @Override
    public int getDataType() {
        return discloseType;
    }

    @Override
    public int getDataViewType() {
        return viewType;
    }

    @Override
    public IListData getOwner() {
        return null;
    }

    @Override
    public String getDataMediaLength() {
        return null;
    }

    @Override
    public boolean shouldShowMedia() {
        return false;
    }

    @Override
    public int getItemMode() {
        return 0;
    }

    @Override
    public boolean isLiving() {
        return false;
    }

    @Override
    public String getDataId() {
        return null;
    }

    @Override
    public String getTime() {
        return pubTime;
    }

    @Override
    public IListShowData getOwenerData() {
        return null;
    }

    @Override
    public Date getDataDate() {
        return null;
    }

    @Override
    public void setDataDate(Date date) {
        pubTimeTemp = date;
    }

    public boolean isShrink() {
        return isShrink;
    }

    public void setShrink(boolean shrink) {
        isShrink = shrink;
    }

    public static int getTypeStrRes(int discloseType) {
        switch (discloseType) {
            default:
                return R.string.rebllion_type_default;
            case Constances.REBELLION_TYPE_BREAKING_NEWS:
                return R.string.rebllion_type_one;
            case Constances.REBELLION_TYPE_EXPERIENCES:
                return R.string.rebllion_type_two;
            case Constances.REBELLION_TYPE_HOT_NEWS:
                return R.string.rebllion_type_three;
            case Constances.REBELLION_TYPE_PIC_NEWS:
                return R.string.rebllion_type_four;
            case Constances.REBELLION_TYPE_VIDEO_NEWS:
                return R.string.rebllion_type_five;
        }
    }

    @NonNull
    @Override
    public String getDatePattern() {
        return "yyyy-MM-dd HH:mm:ss";
    }

    @Override
    public String getDateString() {
        return pubTime;
    }

    public String getCoverImage() {
        return coverImage;
    }

    public void setCoverImage(String coverImage) {
        this.coverImage = coverImage;
    }

    public List<ImageUr> getDiscloseImage() {
        return discloseImage;
    }

    public void setDiscloseImage(List<ImageUr> discloseImage) {
        this.discloseImage = discloseImage;
    }

    public String getDiscloseText() {
        return discloseText;
    }

    public void setDiscloseText(String discloseText) {
        this.discloseText = discloseText;
    }

    public int getDiscloseType() {
        return discloseType;
    }

    public void setDiscloseType(int discloseType) {
        this.discloseType = discloseType;
    }

    public String getDiscloseVideo() {
        return discloseVideo;
    }

    public void setDiscloseVideo(String discloseVideo) {
        this.discloseVideo = discloseVideo;
    }

    public String getLocation() {
        return location;
    }

    public void setLocation(String location) {
        this.location = location;
    }

    public String getPubTime() {
        return pubTime;
    }

    public void setPubTime(String pubTime) {
        if (!TextUtils.equals(pubTime, this.pubTime)) {
            pubTimeTemp = null;
        }
        this.pubTime = pubTime;
    }

    public String getUserAvator() {
        return userAvator;
    }

    public void setUserAvator(String userAvator) {
        this.userAvator = userAvator;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public int getPlayedPos() {
        return playedPos;
    }

    public void setPlayedPos(int playedPos) {
        this.playedPos = playedPos;
    }

    public String getNote() {
        return note;
    }

    public void setNote(String note) {
        this.note = note;
    }

    public boolean getIsComment() {
        return isComment;
    }

    public void setIsComment(boolean isComment) {
        this.isComment = isComment;
    }

    public String getInfoId() {
        return infoId;
    }

    public void setInfoId(String infoId) {
        this.infoId = infoId;
    }

    public String getBaoType() {
        return baoType;
    }

    public void setBaoType(String baoType) {
        this.baoType = baoType;
    }

    public boolean getIsDigg() {
        return isDigg;
    }

    public void setIsDigg(boolean isDigg) {
        this.isDigg = isDigg;
    }

    public String getTopicId() {
        return topicId;
    }

    public void setTopicId(String topicId) {
        this.topicId = topicId;
    }

    public String getTopic() {
        return topic;
    }

    public void setTopic(String topic) {
        this.topic = topic;
    }

    public int getCountDigg() {
        return countDigg;
    }

    public void setCountDigg(int countDigg) {
        this.countDigg = countDigg;
    }

    public ArrayList<FComment> getCommentList() {
        return commentList;
    }

    public void setCommentList(ArrayList<FComment> commentList) {
        this.commentList = commentList;
    }


    public int getCountComment() {
        return countComment;
    }

    public void setCountComment(int countComment) {
        this.countComment = countComment;
    }

    @Override
    public String toString() {
        return "FRebellion{" +
                "coverImage=" + coverImage +
                ", discloseText='" + discloseText + '\'' +
                ", discloseType=" + discloseType +
                ", discloseVideo='" + discloseVideo + '\'' +
                ", location='" + location + '\'' +
                ", pubTime='" + pubTime + '\'' +
                ", userAvator='" + userAvator + '\'' +
                ", userName='" + userName + '\'' +
                ", playedPos=" + playedPos +
                '}';
    }
}
